/* nixonFTP
 * FTP client version 0.1
 * Copyright (C) 2010 NIXON Development Corporation.
 * All rights reserved.
 * http://members.shaw.ca/nixon.com
*/

package nixonftp.ui;

import java.awt.Dimension;
import java.awt.Font;
import javax.swing.JLabel;

public class NXMessageLabel extends JLabel {
	static Font f;
	static Font newF;

	public NXMessageLabel() {
		super();
		f = getFont();
		newF = f.deriveFont(f.getStyle() ^ Font.BOLD);
		setFont(newF);
		//setPreferredWidth(360);
	}

	public void setInfo(String title, String desc) {
		setText("<html><font size='4'><b>" + title +
				  "</b></font><br>" + desc + "</html>");
		Dimension d = getPreferredSize();
		if (d.width > 360) {
			setText("<html><table width='360'><tr><td><font size='4'><b>" + title +
				  "</b></font></td></tr><tr><td>" + desc + "</td></tr></table></html>");
		}
	}
}
